package com.ckf.ckf_live.controller;

import com.ckf.ckf_live.mapper.PowerMapper;
import com.ckf.ckf_live.service.PowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 安详的苦丁茶
 * @version 1.0
 * @date 2020/3/10 15:57
 */

@RestController
public class PowerController {

    @Autowired
    private PowerService powerService;

    @Autowired
    private PowerMapper powerMapper;

    /**
     * 条件查询  批量查询
     *
     * @param
     * @return
     */
    @RequestMapping("/go_power")
    public Map<String, Object> go_power() {

        Map<String, Object> outMap = new HashMap<String, Object>();

        List list = Arrays.asList(1, 2);
        System.out.println(powerMapper.selectBatchIds(list));

        System.out.println("数据--" + list);

        if (list != null) {
            outMap.put("code", 0);
            System.out.println("查询成功");
            outMap.put("msg", "查询成功");
            outMap.put("result", list);
            return outMap;
        } else {
            outMap.put("code", 100);
            System.out.println("查询失败");
            outMap.put("msg", "查询失败");
        }

        return outMap;

    }

}
